<div class="col-md-12">
	<form method="post" class="form-horizontal" action="${cxt!}/wealthcollege/editBook" id="wcbook">
		<input type="hidden" name="wealthCollegeBook.id" value="${updateBook.id!}">
		<div class="form-group">
			<div class="row">
				<div class="col-md-1"></div>
				<div class="col-md-5">
					<label class="col-md-3">${_res["wealth.book.cover"]}:<span class="fontColorRed">&nbsp;*</span></label>
				</div>
				<div class="col-md-1"></div>
				<div class="col-md-5">
					<label class="col-md-3">${_res["wealth.book.content"]}:<span class="fontColorRed">&nbsp;*</span></label>
				</div>
			</div>

			<div class="row">
				<div class="col-md-1"></div>
				<!-- 上传封面 -->
				<div class="col-md-5">
					<div class="col-md-3 proimgfiles">
						<a href="javascript:void(0)" class="filesIconAdd" id="uploadproimgfiles"> 
							<!-- //ajax片段开始 -->
							<%  #ajax uploadproimgfiles: {%> 
								<% if (isEmpty(uploadFile)) { %>
									<img src="${imgCxt!}/${updateBook.coverpricureurl!}" width="100%" height="100%" style="position: relative; z-index: 99999;" >
								<% } else { %>
									<input type="hidden" name="wealthCollegeBook.coverpricureurl" value="${uploadFile.path!}" /> 
									<img src="${imgCxt!}/${uploadFile.path!}" width="100%" height="100%" style="position: relative; z-index: 99999;">
								<% } %>
							<% } %>
							<!-- //ajax片段结尾 -->
						</a> 
						<input type="file" style="opacity: 0" id="fileuploadproimgfiles" name="coverpricureurl" />
					</div>
				</div>

				<div class="col-md-1"></div>
				<!-- 上传文件 -->
				<div class="col-md-5">
					<div class="col-md-3 proimgfiles">
						<a href="javascript:void(0)" class="filesIconAdd" id="uploadDatumFile">
						<!-- //ajax片段开始 -->
						<%  #ajax uploadDatumFile: {%> 
							<% if (!isEmpty(uploadFiles)) { %>
								<input type="hidden" name="wealthCollegeBook.contenturl" value="${uploadFiles.path!}" />
							<%}%>
							<img src="img/cover.png" width="100%" height="100%" style="position: relative; z-index: 99999;">
						<% } %>
						<!-- //ajax片段结尾 -->
						</a>
						<input type="file" style="opacity: 0" id="fileuploadDatumFile" name="contenurl" />
					</div>
				</div>
			</div>
		</div>

		<div class="form-group">
			<div class="row">
				<div class="col-md-3">
					<label class="col-md-6 control-label">${_res["wealth.college.bookname"]}:<span class="fontColorRed">&nbsp;*</span></label>
				</div>
				<div class="col-md-3">
					<input type="text" class="form-control" name="wealthCollegeBook.bookname" required aria-required="true" value="${updateBook.bookname!}">
				</div>
			</div>
		</div>
		<div class="form-group">
			<div class="row">
				<div class="col-md-3">
					<label class="col-md-6 control-label">${_res["wealth.college.theme.introduction"]}:<span class="fontColorRed">&nbsp;*</span></label>
				</div>
				<div class="col-md-4">
					<textarea class="form-control" name="wealthCollegeBook.bookintroduce" style="width: 140%">${updateBook.bookintroduce!}</textarea>
				</div>
			</div>
		</div>
		<div class="form-group">
			<div class="row">
				<div class="col-md-3">
					<label class="col-md-6 control-label">${_res["wealth.book.isfree"]}:<span class="fontColorRed">&nbsp;*</span></label>
				</div>
						
				<div class="col-md-5">
					<#dict type="radio"  name="wealthCollegeBook.isfree" dictCode="COMMON_YN" defaultValue="${updateBook.isfree!}"/>
				</div>
			</div>
		</div>
		<div class="form-group">
			<div class="row">
				<div class="col-md-3">
					<label class="col-md-6 control-label">${_res["wealth.college.bookprice"]}:<span class="fontColorRed">&nbsp;*</span></label>
				</div>
				<div class="col-md-3">
					<input type="text" class="form-control" name="wealthCollegeBook.price" value="${updateBook.price!}" required aria-required="true">
				</div>
			</div>
		</div>
		<div class="form-group">
			<div class="row">
				<div class="col-md-3">
					<label class="col-md-6 control-label">${_res["wealth.college.usergroup"]}:<span class="fontColorRed">&nbsp;*</span></label>
				</div>
				<div class="col-md-3">
					<#dict type="select" multiple="multiple" name="wealthCollegeBook.usergroup" table="customer_role"
						filedName="name" value="${updateBook.usergroup!}" filedValue="code" defaultValue="${paramMap['project.f_status']}"/>
				</div>
			</div>
		</div>
		<div class="form-group">
			<div class="row">
				<div class="col-md-6">
					<div class="form-group">
						<label class="col-md-12 control-label "> 
							<% if(hasPrivilegeUrl("getWcbookList")){ %>
								<button type="button" class="btn btn-warning" onClick="ajaxContent('/wealthcollege/getWcbookList');">${_res["system.return"]}</button>
							<% } %> 
							<% if(hasPrivilegeUrl("editBook")){ %>
								<button type="submit" class="btn btn-primary">${_res["system.submit"]}</button> 
							<% } %>
						</label>
					</div>
				</div>
			</div>
		</div>
	</form>
</div>
<#submit formId="wcbook" divId="content" />

<script>
	$(document).ready(function() {
		$("a[id^='upload']").on('click', function() {
			var id = $(this).attr("id");
			$("#file" + id).click();
		});
		//选择文件之后执行上传ajaxFileUpload2(divId,fileElementId,toUrl,uploadType,uploadFiles,callback)
		$("input[id^='fileuploadproimgfiles']").on("change", function() {
			var fileElementId = $(this).attr("id");
			ajaxFileUpload2("uploadproimgfiles",fileElementId,"/realty/wealthcollege/editbook.html#uploadproimgfiles","book","uploadFile");
		});
		
		// 选择文件之后执行上传
		$("input[id^='fileuploadDatumFile'").on("change", function() {
			var fileElementId = $(this).attr("id");
			ajaxFileUpload2("uploadDatumFile",fileElementId,"/realty/wealthcollege/editbook.html#uploadDatumFile","book","uploadFile");
		});
	});
</script>